TABLE OF CONTENTS
popbuttonclass/--background--
popbuttonclass/Methods
popbuttonclass/Attributes
top popbuttonclass/--background--
NAME
Class: popbuttonclass
Superclass: baseclass
Include File:
FUNCTION
To provide you with a class similar to the cycle class in pop-menu
mode. This class however appears to be a button gadget which will snap
down a menu for the user to select an entry without changing anything
to the apperance of the object itself.
Also a checkable (toggle) mode with or without mutual exclusion is
supported.
Sunmouse/Sunkey/AutoPopWindowToFront etc. tools may cause confusion
in combination with this class. When another window is activated while
the popmenu is up intuition will automatically deactivate the menu
selection.
Objects from this class send out the following attribute pairs in
their notification messages:
GA_ID - Gadget object ID.
PMB_MenuNumber - Number of the selected menu.
top popbuttonclass/Methods
NEW METHODS
PMBM_CHECK_STATUS -- This method must be used to see if a menu is
checked or not. The following custom message structure is
used:
struct pmbmCommand {
ULONG MethodID;
ULONG pmbm_MenuNumber;
};
pmbm_MenuNumber -- This must be the ordinal number of the menu
on which the action is done. Please note that you must
make sure that this value is in range otherwise you
definitly will get enforcer hits.
Returns TRUE when the menu is checked and FALSE if not.
PMBM_CHECK_MENU -- Use this method to check a menu. It uses the same
message structure as PMB_CHECK_STATUS.
PMBM_UNCHECK_MENU -- Use this method to un-check a menu. It uses the
same message structure as PMB_CHECK_STATUS.
PMBM_ENABLE_ITEM -- Use this method to enable a menu item. It uses
the same message structure as PMB_CHECK_STATUS. Added by
NMC (12.12.95).
PMBM_DISABLE_ITEM -- Use this method to disable a menu item. It uses
the same message structure as PMB_CHECK_STATUS. Added by
NMC (12.12.95).
PMBM_ENABLE_STATUS -- Use this method to find out if a menu item
is enabled or disabled. It uses the same message structure
as PMB_CHECK_STATUS. Added by NMC (12.12.95).
Returns TRUE when the menu is enabled and FALSE if not.
CHANGED METHODS
None.
top popbuttonclass/Attributes
NOTE
All baseclass attributes are also valid for this class. Also the
vectorclass attributes can be used with OM_SET on objects from this
class.
NAME
PMB_Image -- ( struct Image * )
FUNCTION
To provide the object with a standard Intuition image or BOOPSI image.
The image will be centered inside the object it's hitbox. This will
override any vectorclass image.
Default is NULL. Applicability is (IS).
NAME
PMB_MenuEntries -- ( UBYTE ** )
FUNCTION
To specify the actual menu entries. This must point to an
array of PopMenu structures. The array must be terminated with a NULL
pm_Label entry.
struct PopMenu {
UBYTE *pm_label;
UWORD pm_Flags;
ULONG pm_MutualExclude;
};
pm_Label -- This should be a pointer to a 0-terminated string which
contains the text for this menu. You can specify PMB_BARLABEL
here to get a seperator bar simular to the seperator bar used
by gadtools. If you make this NULL the array is terminated.
pm_Flags -- The following two flags are supported:
PMF_CHECKIT -- When set, this flag tell's the class that this
menu should toggle it's selected status. A checkmark
image is shown when the menu is selected.
PMF_CHECKED -- When set the menu is selected.
PMF_DISABLED -- When set, the menu item is disabled and
cannot be selected by the user. If it's a check
item, it can still be checked and unchecked by
the application). Added by NMC (12.12.95).
pm_MutualExclude -- This 32 bit value can hold bits which represent
menus which should be de-selected when this menu is checked.
Each set bit means to exclude a menu. I.E. When bit four is
set the fourth menu is de-selected if it is a checkable item.
NOTE: Mutually-excluded items will *not* trigger any
notification so you are responsible to keep track of this.
Please take a look at the supplied demo for a working example.
The class will make a private copy of the PopMenu array so the menus
may be used on more than one object.
Default is NULL. Applicability is (I).
NAME
PMB_MenuNumber -- ( ULONG )
FUNCTION
This attribute holds the ordinal number of the last selected menu.
When your application is notified by the gadget you should OM_GET
this attribute to find out which menu was selected.
Applicability is (GN).
NAME
PMB_PopPosition -- ( ULONG )
FUNCTION
To make the class pop the menu with a specific entry as the first
one activated. When the object is activated by a mouse-click the menu
will try to open with the specified item under the mouse pointer. Key-
board activation will simple pop the menu with the item selected.
NMC (10.12.95) - Specifying a PMB_PopPosition of ~0 makes the menu
always open under the object, even when activated by a mouse-click.
Applicability is (I).